<?php
# http://projects:8081/cdapp-2kt-api/api/activity_notam_get.php

include_once './_portal.php';

$now_time = date('Y-m-d H:i:s', time() - 48 * 3600);
$sql = "SELECT * FROM 2kt_notam_record WHERE `expirationTime` >= '{$now_time}' AND `cancelled` = 0";
$result = query_parse(exec_sql($sql));
$refresh_info = get_param('activityNOTAMRefreshTime');
$response_version = $refresh_info['version'];
$disabled = (get_variable('STOP_ALL_NETWORK') === 1 || get_variable('STOP_SIPDS') === 1);
// var_dump($result);
output(['count' => count($result), 'version' => $response_version, 'content' => $result, 'disabled' => $disabled]);